#!/usr/bin/env python3

import depthai as dai
import json

device = dai.Device(dai.UsbSpeed.HIGH)
print(f'Is EEPROM available: {device.isEepromAvailable()}')

# User calibration
try:
    print(f'User calibration: {json.dumps(device.readCalibration2().eepromToJson(), indent=2)}')
except Exception as ex:
    print(f'No user calibration: {ex}')

# Factory calibration
try:
    print(f'Factory calibration: {json.dumps(device.readFactoryCalibration().eepromToJson(), indent=2)}')
except Exception as ex:
    print(f'No factory calibration: {ex}')
